//
//  ChartDateFormatter.m
//  CorePlotTest
//
//  Created by zhangjikun on 12-11-9.
//
//

#import "ChartDateFormatter.h"

@implementation ChartDateFormatter

- (id)init
{
    self = [super init];
    if (self) {
        // Initialization code here.
    }
    return self;
}
- (id)initWithDates: (NSMutableArray *)inDates STEP:(int)nVal
{
    if(self = [super init])
    {
        _dates = inDates;
        nStep = nVal;

   }
    return self;
}
- (NSString *)stringForObjectValue: (NSDecimalNumber *)coordinateValue {
    
    int n = coordinateValue.intValue / nStep;
    NSString *str = nil;
    if(n < [_dates count]) str = [_dates objectAtIndex:n];
    return str;
}
@end
